how to find the last non repeating character in a given stirng